#include "settingsdialogimage.h"
#include "ui_settingsdialogimage.h"

#include <QMessageBox>
#include <QPaintEvent>
#include <QPainter>

SettingsDialogImage::SettingsDialogImage(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::SettingsDialogImage)
    , m_pixmap(":/assets/dialogimg.png")
{
    ui->setupUi(this);

    if (m_pixmap.isNull())
        QMessageBox::critical(this, "Warnning", "the logo is empty!");
}

SettingsDialogImage::~SettingsDialogImage()
{
    delete ui;
}

void SettingsDialogImage::paintEvent(QPaintEvent *event)
{
    QPainter painter(this);

    painter.save();

    painter.drawPixmap(event->rect(), m_pixmap);

    painter.restore();

    QWidget::paintEvent(event);
}
